<template>
  <div class="content">
    <div>
      <Nav></Nav>
    </div>
    <div class="main">
      <div class="menue">
      <div class="menue-image">
        <img src="../static/imgs/logo.png" alt="">
      </div>
      <div class="menue-tab">
        <el-menu class="flex" :default-active="activeIndex" mode="horizontal" @select="handleSelect">
          <el-menu-item index="home">首页</el-menu-item>
          <el-menu-item index="goods">全部商品</el-menu-item>
          <el-menu-item index="about">关于我们</el-menu-item>
        </el-menu>
      </div>
      <div class="menue-search">
        <div class="search">
          <el-input placeholder="请输入内容" v-model="searchInput">
            <el-button slot="append" icon="el-icon-search"></el-button>
          </el-input>
        </div>
      </div>
    </div>
    </div>
    <div class="model-view">
      <div class="view">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
import Nav from '../components/header/Nav.vue'
import '../assets/css/style.css'
export default {
  data() {
    return {
      activeIndex: "home",
      searchInput:'',
    };
  },
  components:{
    Nav
  },
  created(){
  },
  methods: {
    handleSelect(key, keyPath) {
      if(this.$route.name != keyPath[0] && keyPath[0] != 'search'){
        this.$router.push({name:keyPath[0]})
      }
    }
  }
};
</script>

<style scoped>
.flex {
  display: flex;
}
.el-menu-demo{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.main {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 10px;
}
.menue{
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 80%;
  border-bottom: 1px solid #ccc;
}
.menue-tab{
  display: flex;
  margin-left: -200px;
}
.model-view{
  display: flex;
  justify-content: center;
  background-color: #f5f5f5;

}
.view{
  width: 100%;
}
.form_item{
  margin-right: 60px;
}
</style>